" Input: {
input_string - original string with placeholders for substitution
mapping - dictionary to subsitute from
(input_open) - opening marker for the keyword in the input_string
(input_close) - closing marker for the keyword in the input_string
(tolerant) - if "yes", do not fail if a keyword is missing from mapping
}
Output: {
return - return code = 0, if successful
> 0, if error
(error) - error text if return > 0
}
Tests:
ck substitute_from_dict misc --input_string='alpha $<>$ gamma' "@@@{'mapping': {'FOO': 'beta'}}"
ck substitute_from_dict misc --input_string='alpha$#dir_sep#$gamma $#foo#$X' \\
"@@@{'mapping': {'dir_sep': '/'}}" --input_open='$#' --input_close='#$' --tolerant
"